---
layout: m1x_soap
title: Set Special Price
---


<h2><a name="catalog_product.setSpecialPrice-Module%3AMageCatalog"></a>Module: Mage_Catalog</h2>


<h4><a name="catalog_product.setSpecialPrice-Resource%3Acatalogproduct"></a>Resource: catalog_product</h4>

<p><b>Aliases:</b></p>
<ul>
	<li>product</li>
</ul>


<h5><a name="catalog_product.setSpecialPrice-Method%3A"></a>Method:</h5>

<ul>
	<li>catalog_product.setSpecialPrice (SOAP V1)</li>
	<li>catalogProductSetSpecialPrice (SOAP V2)</li>
</ul>


<p>Allows you to set the product special price.</p>

<p><b>Aliases:</b></p>
<ul>
	<li>product.setSpecialPrice</li>
</ul>

<p><strong>Note:</strong></p>
<p>Although the API accepts up to four digits of precision for all price arguments, Magento strongly recommends you pass in two digits to reduce inaccuracy in the tax calculation process. (That is, use a price like 12.35 and not 12.3487).</p>

<p><b>Arguments:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId <br class="atl-forced-newline" /> </td>
<td> Session ID </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> productId <br class="atl-forced-newline" /> </td>
<td> Product ID or SKU </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> specialPrice <br class="atl-forced-newline" /> </td>
<td> Product special price </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> fromDate <br class="atl-forced-newline" /> </td>
<td> Date starting from which special price will be applied </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> toDate <br class="atl-forced-newline" /> </td>
<td> Date till which special price will be applied </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> storeView <br class="atl-forced-newline" /> </td>
<td> Store view ID or code (optional) </td>
</tr>
<tr>
<td> string </td>
<td> productIdentifierType </td>
<td> Defines whether the product ID or SKU is passed in the 'productId' parameter (optional) </td>
</tr>
</tbody></table>



<p><b>Returns</b>:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> boolean/int </td>
<td> result </td>
<td> True (1) if the special price is set for the product </td>
</tr>
</tbody></table>



<h4><a name="catalog_product.setSpecialPrice-Examples"></a>Examples</h4>

<h5><a name="catalog_product.setSpecialPrice-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$client = new SoapClient('http://magentohost/api/soap/?wsdl');

// If somestuff requires api authentification,
// then get a session token
$session = $client-&gt;login('apiUser', 'apiKey');

$result = $client-&gt;call($session, 'catalog_product.setSpecialPrice', array('product' =&gt; 'testproduct', 'specialPrice' =&gt; '77.5', 'fromDate' =&gt; '2012-03-29 12:30:51', 'toDate' =&gt; '2012-04-29 12:30:51'));
var_dump($result);

// If you don't need the session anymore
//$client-&gt;endSession($session);</pre>
		</div>
</div></div>

<h5><a name="catalog_product.setSpecialPrice-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy-&gt;login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary

$result = $proxy-&gt;catalogProductSetSpecialPrice($sessionId, '2', '77.5', '2012-03-29 12:30:51', '2012-04-29 12:30:51');
var_dump($result);</pre>
		</div>
</div></div>

<h5><a name="catalog_product.setSpecialPrice-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey'));

$result = $proxy-&gt;catalogProductSetSpecialPrice((object)array('sessionId' =&gt; $sessionId-&gt;result, 'productId' =&gt; '2', 'specialPrice' =&gt; '77.5', 'fromDate' =&gt; '2012-03-29 12:30:51', 'toDate' =&gt; '2012-04-29 12:30:51'));
var_dump($result-&gt;result);</pre>
		</div>
</div></div>

<?php include(__ROOT__ . 'footer.php'); ?>
